package com.qys.livesMall.anchor.controller.app;


import com.baomidou.mybatisplus.core.metadata.IPage;
import com.qys.livesMall.anchor.model.vo.lives.app.LiveWatchRecordVO;
import com.qys.livesMall.anchor.service.LiveWatchRecordService;
import com.qys.livesMall.common.result.R;
import com.qys.livesMall.framework.view.BaseQuery;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.*;

/**
 * 直播观看记录表(LiveWatchRecord)表控制层
 *
 * @author makejava
 * @since 2023-09-14 14:47:52
 */
@RestController
@RequestMapping("/app/liveWatchRecord")
@Tag(name = "App-直播观看记录", description = "App-直播观看记录")
public class LiveWatchRecordController {
    /**
     * 服务对象
     */
    @Resource
    private LiveWatchRecordService liveWatchRecordService;

    /**
     * 分页查询所有数据
     *
     * @param dto 查询实体
     * @return 所有数据
     */
    @PostMapping("/selectAll")
    @Operation(summary = "分页查询当前用户的观看直播记录")
    public R<IPage<LiveWatchRecordVO>> selectAll(@RequestBody BaseQuery dto) {
        return R.ok(liveWatchRecordService.selectAll(dto));
    }

    @PostMapping("/del/{id}")
    @Operation(summary = "删除直播记录")
    public R<?> del(@PathVariable Long id) {
        liveWatchRecordService.del(id);
        return R.ok();
    }

}

